package com.wty.learnsping.servletConfig;

import com.wty.learnsping.servlet.MyServlet1;
import com.wty.learnsping.servlet.MyServlet2;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;

//@Configuration
public class servletConfig {



    @Bean
    public ServletRegistrationBean testRegistration12(){
        ServletRegistrationBean registration=new ServletRegistrationBean(new MyServlet1());
        registration.addUrlMappings("*.hello");
        return registration;
    }


    @Bean
    public ServletRegistrationBean testRegistration2(){
        ServletRegistrationBean registration=new ServletRegistrationBean(new MyServlet2());
        registration.addUrlMappings("*.hello2");
        return registration;
    }

//    @Bean
//    public ServletRegistrationBean dispatcherRegistration(DispatcherServlet dispatcherServlet) {
//        ServletRegistrationBean registration = new ServletRegistrationBean(dispatcherServlet);
//        registration.getUrlMappings().clear();
//        registration.addUrlMappings("*.do");
//        registration.addUrlMappings("*.json");
//        return registration;
//    }
}
